home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / wmfbmp / wmf2bmp.frm < prev    next >
Text File  |  1992-12-03  |  7KB  |  274 lines

  1. VERSION 2.00
  2. Begin Form WMF2BMP 
  3.    Caption         =   "WMF2BMP"
  4.    Height          =   6210
  5.    Icon            =   WMF2BMP.FRX:0000
  6.    Left            =   255
  7.    LinkTopic       =   "Form1"
  8.    ScaleHeight     =   368
  9.    ScaleMode       =   3  'Pixel
  10.    ScaleWidth      =   599
  11.    Top             =   885
  12.    Width           =   9105
  13.    Begin CommandButton Command6 
  14.       Caption         =   "Revert"
  15.       Height          =   315
  16.       Left            =   120
  17.       TabIndex        =   12
  18.       Top             =   1320
  19.       Width           =   855
  20.    End
  21.    Begin HScrollBar HScroll1 
  22.       Height          =   315
  23.       LargeChange     =   50
  24.       Left            =   120
  25.       Max             =   1024
  26.       Min             =   32
  27.       SmallChange     =   5
  28.       TabIndex        =   8
  29.       Top             =   3540
  30.       Value           =   32
  31.       Width           =   855
  32.    End
  33.    Begin CommandButton Command5 
  34.       Caption         =   "Clear"
  35.       Height          =   315
  36.       Left            =   120
  37.       TabIndex        =   7
  38.       Top             =   2160
  39.       Width           =   855
  40.    End
  41.    Begin CommandButton Command4 
  42.       Caption         =   "Load"
  43.       Height          =   315
  44.       Left            =   120
  45.       TabIndex        =   6
  46.       Top             =   480
  47.       Width           =   855
  48.    End
  49.    Begin CommandButton Command3 
  50.       Caption         =   "Exit"
  51.       Height          =   315
  52.       Left            =   120
  53.       TabIndex        =   5
  54.       Top             =   2580
  55.       Width           =   855
  56.    End
  57.    Begin CommandButton Command2 
  58.       Caption         =   "Save"
  59.       Height          =   315
  60.       Left            =   120
  61.       TabIndex        =   4
  62.       Top             =   1740
  63.       Width           =   855
  64.    End
  65.    Begin CommandButton Command1 
  66.       Caption         =   "Convert"
  67.       Enabled         =   0   'False
  68.       Height          =   315
  69.       Left            =   120
  70.       TabIndex        =   3
  71.       Top             =   900
  72.       Width           =   855
  73.    End
  74.    Begin PictureBox Picture2 
  75.       AutoSize        =   -1  'True
  76.       Height          =   2115
  77.       Left            =   5040
  78.       ScaleHeight     =   139
  79.       ScaleMode       =   3  'Pixel
  80.       ScaleWidth      =   255
  81.       TabIndex        =   2
  82.       Top             =   480
  83.       Width           =   3855
  84.    End
  85.    Begin PictureBox Picture1 
  86.       AutoRedraw      =   -1  'True
  87.       AutoSize        =   -1  'True
  88.       Height          =   2115
  89.       Left            =   1080
  90.       ScaleHeight     =   139
  91.       ScaleMode       =   3  'Pixel
  92.       ScaleWidth      =   239
  93.       TabIndex        =   0
  94.       Top             =   480
  95.       Width           =   3615
  96.    End
  97.    Begin Label Label2 
  98.       Height          =   255
  99.       Left            =   120
  100.       TabIndex        =   11
  101.       Top             =   4320
  102.       Width           =   855
  103.    End
  104.    Begin Label Label4 
  105.       Caption         =   "Scale"
  106.       Height          =   255
  107.       Left            =   120
  108.       TabIndex        =   10
  109.       Top             =   3240
  110.       Width           =   615
  111.    End
  112.    Begin Label Label3 
  113.       Height          =   255
  114.       Left            =   120
  115.       TabIndex        =   9
  116.       Top             =   4020
  117.       Width           =   855
  118.    End
  119.    Begin Label Label1 
  120.       AutoSize        =   -1  'True
  121.       Caption         =   "WMF Image"
  122.       Height          =   195
  123.       Left            =   1080
  124.       TabIndex        =   1
  125.       Top             =   180
  126.       Width           =   1020
  127.    End
  128.    Begin Menu filemen 
  129.       Caption         =   "&File"
  130.       Begin Menu exitmen 
  131.          Caption         =   "E&xit"
  132.       End
  133.    End
  134.    Begin Menu aboutmen 
  135.       Caption         =   "&About"
  136.       Begin Menu proginfomen 
  137.          Caption         =   "&About WMF2BMP"
  138.       End
  139.       Begin Menu ososoftmen 
  140.          Caption         =   "&Other OsoSoft Programs"
  141.       End
  142.    End
  143. End
  144. '* Be sure to check the properties of all controls,
  145. 'since they are not set in code, but are very important.
  146. 'Especially check the properties of picture controls!
  147.  
  148. Dim theratio As Single
  149. Dim oldwidth As Integer
  150.  
  151. Sub command1_click ()
  152. screen.MousePointer = 11
  153. label1.Caption = "PCX Image"
  154. picture1.Visible = 0
  155. picture2.Left = picture1.Left
  156. picture2.Top = picture1.Top
  157. picture2.Visible = -1
  158. picture2.Picture = picture1.Image
  159. command2.Enabled = True
  160. hscroll1.Enabled = 0
  161. screen.MousePointer = 0
  162. End Sub
  163.  
  164. Sub command2_click ()
  165. If picture2.Visible = 0 Then Exit Sub
  166.  
  167. newfile$ = UCase$(Left$(thefile$, InStr(thefile$, "."))) + "BMP"
  168. fileroot$ = InputBox("Enter Filename.", "WMF2BMP", newfile$)
  169.  
  170. If InStr(fileroot$, ".") = 0 Then
  171.     If Len(fileroot$) < 9 Then wholename$ = fileroot$ + ".BMP"
  172.     Else wholename$ = fileroot$
  173. End If
  174.  
  175. If InStr(wholename$, "\") = 0 Then wholename$ = thepath$ + wholename$
  176. On Error GoTo badfile
  177.  
  178. SavePicture picture2, wholename$
  179. GoTo getout
  180.  
  181. badfile:
  182. msg$ = "Invalid filename. File not saved."
  183. MsgBox msg$
  184. Resume getout
  185.  
  186. getout:
  187. End Sub
  188.  
  189. Sub Command3_Click ()
  190. End
  191. End Sub
  192.  
  193. Sub Command4_Click ()
  194. getfile.Show 1
  195.  
  196. If thefile$ = "" Then Exit Sub
  197.  
  198. command2.Enabled = False
  199. picture2.Visible = False
  200. picture1.Visible = True
  201. label1.Caption = "WMF Image"
  202. picture1.Picture = LoadPicture(thefile$)
  203. label3.Caption = Str$(picture1.Width) + "W"
  204. label2.Caption = Str$(picture1.Height) + "H"
  205. theratio = picture1.Width / picture1.Height
  206. oldwidth = picture1.Width
  207. hscroll1.Value = picture1.Width
  208. command1.Enabled = -1
  209. End Sub
  210.  
  211. Sub Command5_Click ()
  212. picture1.Picture = LoadPicture("")
  213. picture2.Picture = LoadPicture("")
  214. picture1.Visible = -1
  215. picture2.Visible = -1
  216. label1.Caption = "WMF"
  217.  
  218.  
  219. End Sub
  220.  
  221. Sub Command6_Click ()
  222. picture1.Visible = -1
  223. picture1.Picture = LoadPicture("")
  224. picture1.Picture = LoadPicture(thefile$)
  225. picture2.Picture = LoadPicture("")
  226. picture2.Visible = 0
  227. hscroll1.Enabled = -1
  228. hscroll1.Value = oldwidth
  229. label1.Caption = "WMF Image"
  230. command2.Enabled = 0
  231. End Sub
  232.  
  233. Sub Exitmen_Click ()
  234. End
  235. End Sub
  236.  
  237. Sub Form_Load ()
  238. picture2.Visible = 0
  239. command2.Enabled = False
  240.  
  241. End Sub
  242.  
  243. Sub Form_Unload (Cancel As Integer)
  244. Unload orderform
  245. Unload getfile
  246. End Sub
  247.  
  248. Sub HScroll1_Change ()
  249. picture1.Width = hscroll1.Value
  250. picture1.Height = Int(picture1.Width / theratio)
  251. hcaption = Str$(picture1.Width) + "W"
  252. vcaption = Str$(picture1.Height) + "H"
  253. label3.Caption = hcaption
  254. label2.Caption = vcaption
  255. End Sub
  256.  
  257. Sub ososoftmen_Click ()
  258. orderform.Show 1
  259. End Sub
  260.  
  261. Sub proginfomen_Click ()
  262. nl$ = Chr$(13) + Chr$(10)
  263. msg$ = "WMF2BMP is a Free program from OsoSoft, but is Copyright, 1992, by OsoSoft and George Campbell. All Rights Reserved."
  264. msg$ = msg$ + " You may use this program freely, but must distribute it only in an unaltered form, complete with WMF2BMP.WRI."
  265. msg$ = msg$ + " You may not distribute this program as part of any commercially distributed program without written permission."
  266. msg$ = msg$ + nl$ + nl$ + "OsoSoft"
  267. msg$ = msg$ + nl$ + "1472 Sixth Street"
  268. msg$ = msg$ + nl$ + "Los Osos, CA  93402"
  269. msg$ = msg$ + nl$ + "OsoSoft BBS: (805) 528-3753, 300-2400, 8N1"
  270. MsgBox msg$
  271.  
  272. End Sub
  273.  
  274.